<?php

namespace app\adminapi\controller;

use app\adminapi\service\SysFileService;
use app\adminapi\validate\SysFileValidate;
use app\common\controller\BaseAdminController;

class CommonController extends BaseAdminController
{
    public array $notNeedLogin = ['upload'];

    public function upload()
    {
        $param = (new SysFileValidate())->post()->goCheck('upload');
        $file = request()->file('file');
        $result = (new SysFileService())->addSysFile($param, $file);
        return app('json')->successWithData($result);
    }
}